Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better way of finding term starts #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

alexdutton
Copy link
Contributor

The previous way of finding the start of a term for a date had the following issues:

  • it looked through all known term starts and compared against each. As the number of known-about terms increases, this is going to get slightly slow (particularly when looking up lots of dates)
  • it will never return the last known-about term as it always finds a pair of term starts between which the given date falls

This narrows the search range down to a year either side of the date (I think this could be reduced further to the year before and the current year; however as it searches forwards in time, it should never reach the last year).

It will also return the last term when appropriate.

@davbo
Copy link
Contributor

davbo commented Feb 3, 2014

@alexsdutton were you adding some tests for this?

@alexdutton
Copy link
Contributor Author

Yes, but I'm being slow. It probably won't be this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants